เข้าสู่ระบบ สมัครสมาชิก

modulo operator การใช้

ประโยคมือถือ
  • Most programming languages have a modulo operator for this.
  • You can do that using a modulo operator.
  • Notice how the modulo operator always guarantees that only the fractional sum will be kept.
  • :: : : Programming languages normally provide a modulo operator that gives you the remainder that division would produce.
  • This is accurate for integers up to 2 ^ 53; for larger integers Lua's modulo operator may return an erroneous value.
  • This is useful if the modulo operation is a significant part of the performance critical path as this can be much faster than the regular modulo operator.
  • Read carefully about the use of the modulo operator, which is key to the latter .-- T 21 : 12, 26 September 2006 ( UTC)
  • Note : unsigned char is typically used in C to represent a byte and CHAR _ BIT is most often 8 on modern processors . % is the C modulo operator.
  • This function deals with this problem by returning 0 if the modulo given by Lua's modulo operator is less than 0 or greater than " y ".
  • A simple and commonly used way to force such numbers into a desired smaller range is to apply the modulo operator; that is, to divide them by the size of the range and take the remainder.
  • In this method, the " hash " is independent of the array size, and it is then " reduced " to an index ( a number between 0 and array _ size  " 1 ) using the modulo operator ( % ).